// importScripts('_www/static/test2.js');
// importScripts('_www/static/new_file.js');

for(let i = 0;i<1000000;i++){
	setTimeout(function(index){
		// console.log(index)
		
		if(index == 1000000-1){
			postMessage('完成');
		}
	},1000,i)
	// postMessage( JSON.stringify({index:i}))
};

const myBuf = new ArrayBuffer(99);

postMessage(myBuf,[myBuf]);

onmessage = function(e){
	console.log("message");
	try{
		console.log(JSON.stringify(e.data));
	}catch(e){
		// 将base64转换为arraybuffer，base64ToUint8Array为插件提供的内置函数
		let bf = base64ToUint8Array(e)
		console.log(bf)
	}
	
};